﻿using System;
using System.Transactions;

namespace Sunyi.Project.WebPoint.Common
{
    public static class TransactionHelper
    {
        public static void ProcessTransaction(Action action)
        {
            using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required))
            {
                action.Invoke();

                ts.Complete();
            }
        }
    }
}
